{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 1. Object Oriented Programming\n", "\n", "In this exploration, we examine the idea of an object, and begin writing our first object-oriented programming study." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#Table of Contents\n", "* [1. Object Oriented Programming](#1.-Object-Oriented-Programming)\n", "\t* [1.1 Old Ball Code](#1.1-Old-Ball-Code)\n", "\t* [1.2 Bouncing Ball as an Object](#1.2-Bouncing-Ball-as-an-Object)\n", "\t* [1.3 Variations](#1.3-Variations)\n", "\t* [1.4 Collision Detection](#1.4-Collision-Detection)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1.1 Old Ball Code" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This code is from the discussion on Bouncing Balls. We need to keep track of the ball's velocities in the `x` and `y` direction, keep track of where it is (`x`, `y`), and the global time. " ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "\n", "